<template>
  <div class="son">
    <h5>我是子组件</h5>
    <div>价格：{{ toSon }}元</div>
    <hr />
    <div>{{ userInfo }}</div>
  </div>
</template>
<script>
export default {
  //   props: ['toSon']
  props: {
    toSon: {
      type: [Number, String],
      default: 5,
      required: true,
      //   validator: value => {
      //     return value < 10
      //   }
      validator: value => value < 200
    },
    userInfo: {
      type: Object,
      default: () => {
        return {
          name: '张三'
        }
      }
    }
  }
}
</script>
<style scoped>
.son {
  width: 300px;
  height: 300px;
  background-color: #f00;
}
</style>
